package com.gitee.wsl.common.ui.symbol.generator

import androidx.compose.ui.graphics.Path
import com.gitee.wsl.common.ui.symbol.Wye
import com.gitee.wsl.common.ui.symbol.wye

fun <T> PathBuilder.Companion.wye(type: (T,index:Int) -> Wye) = WyeGenerator(type)

class WyeGenerator<T>(type: (T,index:Int) -> Wye): SymbolGenerator<T, Wye>(type) {

    override fun <C : Path> build(data: List<T>, path: C): C {
        data.forEachIndexed { index, it ->
            path.wye(type(it,index))
        }
        return path
    }
}

